const db = require('../db/mysqlconfig')
const cb = function(sql, params) {
    //构造promise
    return new Promise((resolve, reject) => {
        db.query(sql, params, (err, resualt) => {
            if (err) {
                reject(err)
            } else {
                reject(resualt)
            }
        })
    })
}
module.exports = cb